package com.zmj.framework.dao.jdbc;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.zmj.framework.bean.MemberLevel;
import com.zmj.framework.dao.MemberLevelDao;

@Repository
public class MemberLevelDaoJdbc implements MemberLevelDao {
	@Autowired
	FrmJdbcTemplate jdbcTemplate;

	@SuppressWarnings("unchecked")
	public MemberLevel getMemberLevelById(String hyjb) {
		String tmpSql = "select * from member_level where hyjb='" + hyjb + "'";
		List<MemberLevel> list = this.jdbcTemplate.queryForList(tmpSql,MemberLevel.class);
		if ((list == null) || (list.size() == 0)) {
			return null;
		}
		return ((MemberLevel) list.get(0));
	}
	@SuppressWarnings("unchecked")
	public List<MemberLevel> getAllMemberLeveList() {
		String tmpSql = "select * from member_level";
		List<MemberLevel> list = this.jdbcTemplate.queryForList(tmpSql,MemberLevel.class);
		return list;
	}

}
